package com.hang.jvm.risc;

public class ControlUnit {
    private long pc;
    private InstructionDecoder decoder;
    private Memory memory;

    public ControlUnit(InstructionDecoder decoder, Memory memory) {
        this.decoder = decoder;
        this.memory = memory;
        this.pc = 0;
    }

    public void step() {
        long instruction = memory.loadWord(pc);
        decoder.decode(instruction);
        pc += 4;
    }
}
